package cn.jeeweb.web.modules.equipment.service.impl;

import cn.jeeweb.common.mybatis.mvc.service.impl.CommonServiceImpl;
import cn.jeeweb.web.modules.equipment.entity.EqsRepair;
import cn.jeeweb.web.modules.equipment.mapper.EqsRepairMapper;
import cn.jeeweb.web.modules.equipment.service.IEqsRepairService;
import cn.jeeweb.web.modules.sys.entity.CodeTable;
import cn.jeeweb.web.modules.sys.service.ICodeTableService;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
* @description: eqs_repair服务接口
*/
@Transactional
@Service("eqsRepairService")
public class EqsRepairServiceImpl extends CommonServiceImpl<EqsRepairMapper,EqsRepair> implements IEqsRepairService {

    @Autowired
    ICodeTableService codeTableService;

    @Override
    public void insertEqsRepair(EqsRepair eqsRepair) {
        baseMapper.insertEqsRepair(eqsRepair);
    }

//    @Override
//    public EqsRepair insertAndSelect(String json){
//        EqsRepair eqsRepair = JSON.parseObject(json, EqsRepair.class);
//        CodeTable codeTable = new CodeTable();
//        codeTable.setCode("RPAUTOCODE");
//        eqsRepair.setCode(codeTableService.createNewCode(codeTable));
//        return super.insertAndSelect(JSON.toJSONString(eqsRepair));
//    }
}